package com.ysz.component.tableshard.strategy;

import java.time.LocalDate;

/**
 * @ClassName YearTableShardStrategy
 * @Description 按年分表
 * @Data 14:22
 * @Version 1.0
 * @Author ysz
 */
public class YearTableShardStrategy implements TableShardStrategy {

    @Override
    public String tableShard(String originalSql, String tableName, long specifyDay) {
        return originalSql.replaceAll(tableName, tableName + "-" + LocalDate.now().getYear());
    }
}
